<?php
/**
 * Money Controller.
 *  
 * @author Nguyen Hai Ha
 * @version 1.0
 */

class Member_MoneyController extends Zend_Controller_Action {
	protected $_baseUrl;
	protected $_contextPath;
	protected $_utilities;
	protected $_auth;
	
	public function init() {
		$this->_baseUrl = $this->_request->getBaseURL ();
		$this->_contextPath = "member/money";
		
		$this->view->assign ( "baseUrl", $this->_baseUrl );
		$this->view->assign ( "contextPath", $this->_contextPath );
		
		$this->_utilities = new Utilities ( );
		$this->view->assign ( "utilities", $this->_utilities );
		
		$this->_auth = Zend_Auth::getInstance ()->getIdentity ();
	}
	
	public function indexAction() {
	}
	
	public function viewAction() {
		$user_id = $this->_auth->usr_id;
		$userModel = new UserModel ( );
		$account = $userModel->getUserById ( $user_id );
		$this->view->assign ( "account", $account );
		
		$this->render ( "view" );
	}
	public function awardedAction() {
	}
	
	public function paidAction() {
	}
	
	public function historyAction() {
		$account_id = $this->_auth->usr_mobile;
		$historyModel = new HistoryModel();
		$history = $historyModel->getHistoryByAccount($account_id);
		
		$this->view->assign("history", $history);
	}

}//End class.